package com.tarena.luban.demo.rocket.consumer;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "rocket-topic-test",consumerGroup = "gga")
public class MyConsumer implements RocketMQListener<String> {
    /**
     * onMessage每次执行,都会拿到主题中某个队列一个消息数据
     * @param message
     */
    @Override
    public void onMessage(String message) {
        System.out.println("消费者获取消息:"+message);
    }
}
